﻿CREATE TABLE [dbo].[DatabaseTraceDetails] (
    [RowNumber]          BIGINT         IDENTITY (0, 1) NOT NULL,
    [DatabaseTraceId]    INT            NOT NULL,
    [EventClass]         NVARCHAR (4000) NULL,
    [TextData]           NVARCHAR (MAX) NULL,
    [ApplicationName]    NVARCHAR (4000) NULL,
    [NTUserName]         NVARCHAR (4000) NULL,
    [LoginName]          NVARCHAR (4000) NULL,
    [CPU]                INT            NULL,
    [Reads]              BIGINT         NULL,
    [Writes]             BIGINT         NULL,
    [Duration]           BIGINT         NULL,
    [ClientProcessID]    INT            NULL,
    [SPID]               INT            NULL,
    [StartTime]          DATETIME       NULL,
    [EndTime]            DATETIME       NULL,
    [ServerName]         NVARCHAR (4000) NULL,
    [DatabaseName]       NVARCHAR (4000) NULL,
    [ObjectName]         NVARCHAR (4000) NULL,
    [HostName]           NVARCHAR (4000) NULL,
    [NormalizedTextData] NVARCHAR (MAX) NULL,
    CONSTRAINT [PK_DatabaseTraceDetails] PRIMARY KEY CLUSTERED ([RowNumber] ASC),
    CONSTRAINT [FK_DatabaseTraceDetails_DatabaseTrace] FOREIGN KEY ([DatabaseTraceId]) REFERENCES [dbo].[DatabaseTrace] ([DatabaseTraceId])
);

